<div class="box box-solid">
    <div class="box-body table-responsive no-padding">

        <div class="box-body">
                <div class="form-group">
                    <table class="table table-hover table-bordered">
                        <tr>
                            <th>编号</th>
                            <th>关键词</th>
                            <th>搜索次数</th>
                            <th>类型</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                            <?php if(!empty($result['data'] )): ?>
                                <?php foreach ($result['data'] as $key => $value) :?>
                                <tr>
                                    <td><?php echo $value['id']; ?></td>
                                    <td><?php echo $value['title']; ?></td>
                                    <td><?php echo $value['num']; ?></td>
                                    <td><?php if ($value['type'] == SearchLog::TYPE_MANAGER) {
                                        echo('管理员添加,初始值:'.$value['init_count']);
                                    } else {
                                        echo '自然生成';
                                    } ?></td>
                                    <td>
                                        <?php if($value['status'] == SearchLog::STATUS_NORMAL) : ?>
                                            <span class="label label-success">正常</span>
                                        <?php  else : ?>
                                            <span class="label label-danger">禁用</span>
                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        <?php if($value['status'] == SearchLog::STATUS_NORMAL) : ?>
                                            <a  onclick="return confirm('确定要禁用吗?');" href="<?php echo $this->createUrl('system/searchstatus/id/'.$value['id']) ?>">禁用</a>
                                        <?php  else : ?>
                                            <a  onclick="return confirm('确定要启用吗?');" href="<?php echo $this->createUrl('system/searchstatus/id/'.$value['id']) ?>">启用</a>
                                        <?php endif; ?>
                                            <a onclick="return confirm('确定要删除吗?');" href='<?php echo $this->createUrl("system/searchdelete/id/".$value["id"]) ?>'>删除</a>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </tr>
                    </table>
                </div>
            </div>
    <div class="box-footer clearfix">
    <a class="btn btn-default pull-left" href="<?php echo $this->createUrl('system/searchadd') ?>"><i class="fa fa-plus"></i> 添加</a>
    <?php if(!empty($result['data'])): ?>
        <?php  $this->widget('BLinkPager', array('pages'=>$result['pages'])); ?>
    <?php endif; ?>
    </div>
    </div>
</div>